<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>layui</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css"  media="all">
  <link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all" />
  <link rel="stylesheet" href="__CSS__/admin.css"  media="all">
  <style type="text/css">
  /* tooltip */
  #tooltip{
    position:absolute;
    border:1px solid #ccc;
    background:#333;
    padding:2px;
    display:none;
    color:#fff;
  }
  </style>
</head>
<body style="padding:10px;">
  <div class="tplay-body-div">
    <div class="layui-tab">
      <ul class="layui-tab-title">
        <li class="layui-this">拆迁人口管理</li>
          <?php if(!in_array($admin_cate_id,$operation)){ ?>
         <li><a href="{:url('admin/population/add')}" class="a_menu">新增户主</a></li>
          <li><a href="{:url('admin/population/daoru')}" class="a_menu">批量导入户主</a></li>
          <?php } ?>

      </ul>
    </div> 
      <!-- <form class="layui-form serch" action="{:url('admin/population/index')}" method="post">
        <div class="layui-form-item" style="float: left;">
          <div class="layui-input-inline">
            <input type="text" name="keywords" lay-verify="title" autocomplete="off" placeholder="请输入关键词" class="layui-input layui-btn-sm">
          </div>
          <button class="layui-btn layui-btn-danger layui-btn-sm chaxui" lay-submit="" lay-filter="serch">立即查询</button>
        </div>
      </form>  -->
    <table class="layui-table" lay-size="lg">
      <thead>
        <tr>
          <th>序号</th>
          <th>拆迁编号</th>
          <th>评估编号</th>
          <th>户主姓名</th>
          <th>成员</th>
          <th>户主关系</th>
          <th>性别</th>
          <th>年龄</th>
          <th>身份证号</th>
          <th>是否基本村民</th>
          <th>楼号</th>
          <th>状态</th>
            <?php if(!in_array($admin_cate_id,$operation)){ ?>
          <th>操作</th>
            <?php } ?>
        </tr> 
      </thead>
      <tbody>
        {volist name="list" id="vo"}
        <tr>
            <td>{$key+1}</td>
            <td>{$vo.chainum}</td>
            <td>{$vo.pingnum}</td>
            <td><a href="{:url('admin/population/info',['id'=>$vo.id])}" style="color:red">{$vo.name}</a></td>
            <td>{$vo.family}</td>
            <td>{$vo.relation}</td>
            <td>{$vo.sex}</td>
            <td>{$vo.age}</td>
            <td>{$vo.idcar}</td>
            <td>{$vo.iscun}</td>
            <td>{$vo.louhao}</td>
            <td>{$vo.status}</td>
            <?php if(!in_array($admin_cate_id,$operation)){ ?>
            <td class="operation-menu">
              <div class="layui-btn-group">
                <a onclick="edit('{$vo.id}')" class="layui-btn layui-btn-xs a_menu layui-btn-primary" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>
                <a href="javascript:;" class="layui-btn layui-btn-xs layui-btn-primary delete" id="{$vo.id}" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>

              </div>
            </td>
            <?php } ?>
            <!-- <td class="operation-menu">
              <a href="javascript:;" id='{$vo.id}' class="layui-btn layui-btn-xs layui-btn-primary delete" id="" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>
            </td> -->
          </tr>
          <!-- {volist name="vo.child" id="vvo"}
            <tr>
              <td></td>
              <td></td>
              <td></td>
              <td></td>
              <td>{$vvo.name}</td>
              <td>{$vvo.relation}</td>
              <td>{$vvo.sex}</td>
              <td>{$vvo.age}</td>
              <td>{$vvo.idcar}</td>
              <td>{$vvo.iscun}</td> -->
              <!-- <td class="operation-menu">
                <a href="javascript:;" class="layui-btn layui-btn-xs layui-btn-primary delete" id="" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>
              </td> -->
            <!-- </tr>
          {/volist} -->
          
        {/volist}
      </tbody>
    </table>
    <div style="padding:0 20px;"></div> 
    {include file="public/foot"}
  </div>
  <script type="text/javascript">
    $('.delete').click(function(){
      var id = $(this).attr('id');
      layer.confirm('确定要删除?', function(index) {
        $.ajax({
          url:"{:url('admin/population/deleteData')}",
          data:{id:id},
          success:function(res) {
            layer.msg(res.msg);
            if(res.code == 1) {
                layer.alert('删除成功！',{icon:2});
                location.reload();
            }
          }
        })
      })
    })
    function edit(id){
      layer.open({
        type: 2,
        area: [600+'px', 600 +'px'],
        fix: false, //不固定
        maxmin: true,
        shadeClose: true,
        title: "编辑",
        content: "/admin/population/edit.shtml?id=+"+id
    })
    }
    </script>
</body>
</html>